package com.gwsdk.paysdk.acitvityV2.fragment;

import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.gwsdk.paysdk.acitvityV2.GWMainMenuActivity;
public abstract class GWBaseFragment extends Fragment {

    private View rootView;

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootView = inflater.inflate(setContentView(), container, false);
        initView(rootView);
        getData();
        return rootView;
    }

    @SuppressLint("ResourceType")
    public void dismiss(){

        GWMainMenuActivity activity = (GWMainMenuActivity) getActivity();
        activity.popFragment(this);
    }


    public abstract int setContentView();

    public abstract void initView(View view);

    public abstract void getData();

}
